package com.lm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lm.pojo.Resident;
import com.lm.pojo.ResidentChatList;
import com.lm.pojo.ResidentChatList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ResidentMapper extends BaseMapper<Resident> {

    void addHalfResident(Resident resident);

    String getResidentNumber();

    void insertTags(@Param("residentId") Integer residentId,@Param("tagId") Integer tagId);

    void insertFamilyMember(@Param("residentId") Integer residentId,@Param("familyMemberId") Integer familyMemberId,@Param("familyRelation") String familyRelation);

    IPage<Resident> findResidentList(@Param("page") IPage<Resident> page,@Param("residentName") String residentName,@Param("residentPhone") String residentPhone);

    List<ResidentChatList> selectResidentList();

    List<String> findTagsName(Integer residentId);

    List<Integer> findTagId(Integer residentId);

    void deleteResidentAndFamily(Integer residentId);

    void deleteResidentTag(Integer residentId);

    void deleteResidentAndFamilyRelation(Integer residentId);

    void deleteMessage(Integer residentId);

    void deleteResidentHealthInfo(Integer residentId);

    void deleteServiceRecord(Integer residentId);

    void deleteSignRecord(Integer residentId);

    void deleteServiceHealthInfo(Integer healthInfoId);
}
